From 2244f4a7d648b02192d0d23b82567717daa499e3 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Wed, 5 Dec 2012 19:22:36 +0100 Subject: [PATCH] babl: always allocate enough memory --- babl/babl-fish-reference.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c index 05bdc87..abb1b48 100644 --- a/babl/babl-fish-reference.c +++ b/babl/babl-fish-reference.c @@ -289,9 +289,12 @@ process_same_model (const Babl *babl, babl_log ("args=(%p, %p, %p, %li): trying to handle BablImage (unconfirmed code)", babl_fish, source, destination, n); } +#define MAX(a, b) ((a) > (b) ? (a) : (b)) double_buf = babl_malloc (sizeof (double) * n * - BABL (babl->fish.source)->format.model->components); + MAX (BABL (babl->fish.source)->format.model->components, + BABL (babl->fish.source)->format.components)); +#undef MAX if ( (BABL (babl->fish.source)->format.components == -- 2.30.2